home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 3: Developer Tools
/
Linux Cubed Series 3 - Developer Tools.iso
/
devel
/
lang
/
fortran
/
toolpack.000
/
toolpack
/
toolpack1.2
/
util
/
char2.c
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-03-04
|
417 b
|
22 lines
#include <stdio.h>
main(argc, argv)
/* Compiles into char2 */
/* Prints the second character of the first command line argument */
/* on standard output. Used in scripts to get a "key" from an "option" */
/* that is indicated by first character '-' . */
int argc;
char *argv[];
{
char c;
c = (*++argv)[1];
if (c == '\n' || c == '\0')
printf("Fewer than two characters in string.\n");
else
printf("%c", c);
}